class DateUtility
  
  def self.pad_month_with_leading_zero(month)
    if(month.length==1) then
      return "0#{month}"
    else
      return(month)
    end
  end
  
  def self.getCurrentTimeAsUnixTimestamp
    begin
      return Time.now.to_i
    end
  end

  def self.getStartofMonthAsUnixTimestamp(sourceDate)
    begin
      return Time.utc(sourceDate.year(),sourceDate.mon(),01).to_i
    end
  end

  def self.getEndofMonthAsUnixTimestamp(sourceDate)
    begin
      monthEndDate = Date.civil(sourceDate.year(),sourceDate.mon(),-1)
      return Time.utc(monthEndDate.year(),monthEndDate.mon(),monthEndDate.day(),23,59,59).to_i
    end
  end
end
